//
//  DBHelper.h
//  AddressBook
//
//  Created by  on 2020/7/29.
//  Copyright © 2020 wh. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface DBHelper : NSObject
//插入数据
+ (void)insertDataWithName:(NSString *)name
                     phone:(NSString *)phone
                   address:(NSString *)address
                     image:(NSString *)image
              successBlock:(void(^)(void))successBlock
              failureBlock:(void(^)(NSString *str))failureBlock;


//搜索所有数据
+ (void)searchWithsuccessBlock:(void(^)(NSMutableArray *arr))successBlock
                              failureBlock:(void(^)(NSString *str))failureBlock;

 //按照名字搜索
+ (void)searchWithName:(NSString *)name
                      successBlock:(void(^)(NSMutableArray *arr))successBlock
                      failureBlock:(void(^)(NSString *str))failureBlock;

//更新数据
//- (void)updateWithName:(NSString *)name phone:(NSString *)phone address:(NSString *)address;

//按照名字删除
+ (void)deleteWithName:(NSString *)name
          successBlock:(void(^)(void))successBlock
          failureBlock:(void(^)(NSString *str))failureBlock;
@end

NS_ASSUME_NONNULL_END
